// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import "./utils/element.js"
import 'element-ui/lib/theme-chalk/index.css';
Vue.config.productionTip = false

//router.beforeEach((to, from, next) => {
//  document.title = `${to.meta.title}`;
//  const role = localStorage.getItem('admin');
//  const val = eval("(" + role + ")")
//  if (val !== null) {
//    const timeSpan = Date.now() - val.time;
//    if (timeSpan > val.expire) {
//      localStorage.removeItem("admin");
//      next('/login')
//      return null;
//    }
//  }
//  if (!val && to.path != '/login') {
//    next('/login')
//  } else if (to, meta.permission) {//如果有权限的页面才能访问
//    val.value === "admin"?next():next('/403')
//  } else {
//    判断浏览器是否支持富文本编辑器
//    if (navigator.userAgent.indexOf('mise') > -1 && to.path === "/edit") {
//      alert("不支持")
//    } else {
//      next()
//    }
//  }
//})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
